package com.fuction;

import com.pr.service.DubboService;

import java.util.Iterator;
import java.util.ServiceLoader;

/**
 * @description:
 * @projectName:spring-skill
 * @see:org.pr.springskill.fuction
 * @author:LXC
 * @createTime:2024/6/11 10:48
 * @version:1.0
 */
public class ServiceMain {

    public static void main(String[] args) {
        ServiceLoader<DubboService> spiLoader = ServiceLoader.load(DubboService.class);
        Iterator<DubboService> iteratorSpi = spiLoader.iterator();
        while (iteratorSpi.hasNext()) {
            DubboService dubboService = iteratorSpi.next();
            dubboService.sayHello();
        }
    }

}
